<?php
   @require_once("config.php");
   $user_phone=$_GET["user_phone"];
   $user_name=$_GET["user_name"];
   $user_pwd=$_GET["user_pwd"];
   $result_name=mysql_query("select * from userinfo where user_name='$user_name'");
   $result_phone=mysql_query("select * from userinfo where user_phone='$user_phone'");
   $arr=array();
   if(mysql_fetch_row($result_phone)){
      $arr["status"]=false;
      $arr["msg"]='phone is fail';
      $arr["err"]="phone";
   }
   else{
       if(mysql_fetch_row($result_name)){
           $arr["status"]=false;
           $arr["msg"]='name is fail'; 
           $arr["err"]="name";
        }
        else{
       mysql_query("insert into userinfo(user_name,user_pwd,user_phone) value('$user_name','$user_pwd','$user_phone')");    
       if(mysql_affected_rows()>0){
       $arr["status"]=true;
       $arr["msg"]="userinfo";
       }
       else{
       $arr["status"]=false;
       $arr["msg"]="db error";  
       }
      }
   }
   echo json_encode($arr);
?>